package com.lagou.edu.service.impl;

import com.lagou.edu.service.LagouEmailService;
import com.lagou.edu.util.EmailUtil;
import org.apache.dubbo.config.annotation.Service;


@Service(version = "2.7.3")
public class LagouEmailServiceImpl implements LagouEmailService {

    @Override
    public Boolean sendEmail(String email, String code) {
        try {
            //这里邮箱地址和授权码暂时写死，安全性考虑没有放到配置文件中
            EmailUtil.sendEmail("smtp.163.com", "15728009245@163.com",
                    "XJYIMXPVICMKRJPP", email, "验证码", code);
            return true;
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }

    }
}
